package com.vogue.supplymall.account.domain.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.vogue.supplymall.account.domain.dao.UserDao;
import com.vogue.supplymall.account.domain.mapper.UserMapper;
import com.vogue.supplymall.account.domain.model.User;

/**
 * Created by 崔岳 on 2017-12-1.
 */
@Repository("userDao")
public class UserDaoImpl extends BaseDaoImpl<User,Long> implements UserDao{

    @Autowired
    private UserMapper userMapper;

	@Override
	public User getUserByMatchId(String matchId, Long syscodeId) {
		List<User> list = userMapper.getUserByMatchId(matchId, syscodeId);
		if (list != null && list.size()>0) {
			return  list.get(0);			
		}else {
			return null;
		}
	}

	@Override
	public User getUserById(Long userId, Long syscodeId) {
		List<User> list = userMapper.getUserById(userId, syscodeId);
		if (list != null && list.size()>0) {
			return  list.get(0);
		}else {
			return null;
		}
	}
	
}
